package com.ssr.master.common.service;

import com.ssr.master.common.druid.DataSource;
import com.ssr.master.common.druid.DataSourceNames;
import com.ssr.master.modules.entity.SysUser;
import com.ssr.master.modules.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author ZhangPeng
 * @Describe //todo
 * @date
 * @updateBy
 * @other
 **/
@Service("DataSourceTestService")
public class DataSourceTestService {

    @Autowired
    private SysUserService sysUserService;
    @DataSource(DataSourceNames.ONE)
    public SysUser test1(String userId){
        SysUser sysUser = sysUserService.get(userId);
        return sysUser;
    }

    @DataSource(DataSourceNames.TWO)
    public SysUser test2(String userId){
        return sysUserService.getUser(userId);
    }
}
